using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Evolution.Engine.Managers
{
    public class FontManager : Singleton<FontManager>
    {
        private Dictionary<string, SpriteFont> _Fonts = new Dictionary<string, SpriteFont>();

        public FontManager()
        {
            Add(ResourceManager.Instance.LoadContent<SpriteFont>("Content/Fonts/Default"), "Default");
            Add(ResourceManager.Instance.LoadContent<SpriteFont>("Content/Fonts/DialogTitle"), "DialogTitle");
            Add(ResourceManager.Instance.LoadContent<SpriteFont>("Content/Fonts/DefaultBold"), "DefaultBold");
        }

        public void Add(SpriteFont font, string name)
        {
            if (_Fonts.ContainsKey(name))
                return;

            _Fonts.Add(name, font);
        }

        public SpriteFont this[string name]
        {
            get
            {
                if (_Fonts.ContainsKey(name))
                    return _Fonts[name];
                else
                    return _Fonts["Default"];
            }
        }
    }
}
